package com.feige.openfeigh;

import com.feige.constant.Constants;
import com.feige.pojo.Clazz;
import com.feige.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

/**
 * @author feige<br />
 * @ClassName: ClazzService <br/>
 * @Description: <br/>
 * @date: 2021/8/30 21:43<br/>
 */
@Component
@FeignClient(Constants.XIAOFEI_CLOUD_CLASSROOM_COURSE)
public interface ClazzService {
    /**
     * 通过ID查询班级
     * @param id
     * @return
     */
    @GetMapping("/course/clazz/get/{id}")
    R<Clazz> selectById(@PathVariable("id") String id);

    /**
     * 班级人数加1
     * @param id
     * @return
     */
    @PutMapping("/course/clazz/incr/{id}")
    R<Clazz> incrementBy(@PathVariable("id") String id);

    /**
     * 班级人数减一
     * @param id
     * @return
     */
    @PutMapping("/course/clazz/decr/{id}")
    R<Clazz> decrementBy(@PathVariable("id") String id);
}
